<div class="span6">
    <fieldset>
        {foreach from=$aMedia item=item}
        <div class="alert alert-info">
            <a class="close hidden" data-dismiss="alert">x</a>
            <div class="control-group">
                <label class="control-label">Изображение</label>
                <div class="controls">
                    <input type="file" name="eimage[{$item.id}]" class="input-file">
                </div>
            </div>
            {if $item.image}
            <div class="control-group">
                <img width="{$aData.width}" height="{$aData.height}" src="/data/media/{$id}/{$item.image}">
            </div>
            <div class="control-group">
                <label class="control-label">удалить</label>
                <div class="controls">
                    <input type="checkbox" name="del_img[]" value="{$item.id}">
                </div>
            </div>
            {/if}
            <div class="control-group">
                <label class="control-label">Flash</label>
                <div class="controls">
                    <input type="file" name="eflash[{$item.id}]" class="input-file">
                </div>
            </div>
            {if $item.flash}
            <div class="control-group">
                <object type="application/x-shockwave-flash"
                        data="/data/media/{$id}/{$item.flash}"
                        width="{$aData.width}" height="{$aData.height}">
                    <param name="movie" value="/data/media/{$id}/{$item.flash}" />
                    <param name="wmode" value="transparent" />
                </object>
            </div>
            <div class="control-group">
                <label class="control-label">удалить</label>
                <div class="controls">
                    <input type="checkbox" name="del_flash[]" value="{$item.id}">
                </div>
            </div>
            {/if}
        </div>
        {/foreach}
        <div class="form-actions">
            <button class="btn btn-success" type="button" id="btn_add_media">
                <i class="icon-plus icon-white"></i> Добавить</button>
        </div>
    </fieldset>
</div>

{literal}
<script type="text/javascript">

    $(document).ready(function(){
        var sBlock = $('#media_container').html();
        $('#btn_add_media').click(function(){
            $('.span6:eq(1) div.form-actions').before(sBlock);
            $('a.close:last').removeClass('hidden');
        });
    });

</script>
{/literal}